<link rel="stylesheet" type="text/css" href="/templates/styles/tabcontent.css">
<script type="text/javascript" src="/templates/scripts/tabcontent.js"></script>

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td class="bgtitle">
                <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                    <tbody>
                        <tr>
                            <td width="20">
                                <img src="/templates/images/mui_ten.gif">
                            </td>
							<td valign="bottom" class="title">
                                <a href="/{$productcategoryparent[0].parentlink}" class="linkcat20">{$productcategoryparent[0].parentname}</a> 
                                <img src="/templates/images/linev2.jpg"> 
                                <a href="/{$productdetail[0].link}" class="linkcat20">{$productdetail[0].categoryname}</a>
                            </td>
                            <td width="10" valign="bottom">&nbsp;</td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td valign="top">
                <img src="/templates/images/space.gif" width="1" height="10">
            </td>
        </tr>
        <tr>
            <td valign="top">
                <table width="100%" style="border-collapse: collapse" border="0" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
                    <tbody>
                        <tr>
                            <!-- Khung ảnh -->
                            <td valign="top" width="250">
                                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                                    <tbody>
                                        <!-- Đường trên khung ảnh -->
                                        <tr>
                                            <td>
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tbody>
                                                        <tr>
                                                            <td width="11">
                                                                <img src="/templates/images/tbl_pro1.jpg" width="11" height="11">
                                                            </td>
                                                            <td background="/templates/images/tbl_pro2.jpg">
                                                                <img src="/templates/images/tbl_pro2.jpg" width="1" height="11">
                                                            </td>
                                                            <td width="11">
                                                                <img src="/templates/images/tbl_pro3.jpg" width="11" height="11">
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <!-- Khung ảnh -->
                                        <tr>
                                            <td>
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tbody>
                                                        <tr>
                                                            <td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">
                                                                <img src="/templates/images/tbl_pro4.jpg" width="11" height="1">
                                                            </td>
                                                            <td>
                                                                <div align="center">     
                                                                    <!-- Thay đổi ở đây -->
                                                                    <img src="/templates/images/product/{$productdetail[0].image}" alt="{$productdetail[0].productname}" width="180" border="0">
                                                                </div>
                                                            </td>
                                                            <td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">
                                                                <img src="/templates/images/tbl_pro5.jpg" width="11" height="1">
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <!-- Đường dưới khung ảnh -->
                                        <tr>
                                            <td>
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tbody>
                                                        <tr>
                                                            <td width="11">
                                                                <img src="/templates/images/tbl_logo6.jpg" width="11" height="11">
                                                            </td>
                                                            <td background="/templates/images/tbl_logo7.jpg">
                                                                <img src="/templates/images/tbl_logo7.jpg" width="1" height="11">
                                                            </td>
                                                            <td width="11">
                                                                <img src="/templates/images/tbl_logo8.jpg" width="11" height="11">
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                            <td width="30">&nbsp;</td>
                            <!-- Thông tin chính của máy ảnh -->
                            <td valign="top">
                                <!-- Tên của máy ảnh -->
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tbody>
                                        <tr> 
                                            <td class="title16">
                                                <!-- Thay đổi ở đây -->
                                                <strong>{$productdetail[0].productname}</strong>
												{if $promotion_start == 1}
													<img src="/templates/images/sale.png" style="margin-left: 15px; position: absolute;">
													<span style="margin-left: 70px; color: red">
														{$promotionbytime.percentdiscount}%
													</span>
												{/if}
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <img src="/templates/images/space.gif" height="10">
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <!-- Thông tin chính của máy ảnh -->
                                <table width="85%" border="0" cellpadding="5" cellspacing="0">
                                    <tbody>
                                        <tr>
                                            <td class="brd_bott">
                                                <strong>Giá tại MPShop:</strong>
                                            </td>

                                            <td class="brd_bott">
                                                <!-- Thay đổi ở đây -->
                                                <span class="{if $promotion_start == 1}fontgrayprice{else}fontred{/if}">
													{if $promotion_start == 1}
														<strong>
														{/if}
														{$productdetail[0].price|number_format} VNĐ
														{if $promotion_start == 1}
														</strong>
													{/if}
												</span>
												{if $promotion_start == 1}
													<img src="/templates/images/sale_arrow.png" style="position: absolute; margin-top: -11px; margin-left: 11px;">
													<span class="fontred" style="margin-left: 49px;">{($productdetail[0].price*(100-$promotionbytime.percentdiscount)/100)|number_format} VNĐ</span>
												{/if}
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="30%" class="brd_bott">
                                                <strong>Giá hãng:</strong>
                                            </td>
                                            <td class="brd_bott">
                                                <span class="fontgrayprice">
                                                    <!-- Thay đổi ở đây -->
                                                    <strong>{$productdetail[0].price_company|number_format} VNĐ</strong>
                                                </span> 
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="brd_bott">
                                                <strong>Khuyến mãi:</strong>
                                            </td>
                                            <!-- Thay đổi ở đây -->
                                            <td class="brd_bott">{$productdetail[0].promotion}</td>
                                        </tr>
                                        <tr>
                                            <td class="brd_bott">
                                                <strong>Bảo hành:</strong>
                                            </td>
                                            <!-- Thay đổi ở đây -->
                                            <td class="brd_bott">{$productdetail[0].warranty} tháng chính hãng trên toàn quốc</td>
                                        </tr>
                                        <tr>
                                            <td class="brd_bott">
                                                <strong>Màu sắc:</strong>
                                            </td>
                                            <td class="brd_bott">
                                                <table border="0" cellpadding="0" cellspacing="0">
                                                    <tbody>
                                                        <tr>
															{if isset($productdetailcolor)}
                                                            <!-- Thay đổi ở đây, vòng lặp cả 2 td -->
															{foreach from=$productdetailcolor item=productdetailcoloritem}  
																<td>
																	<img src="/templates/images/color/{$productdetailcoloritem.colorname}.png" alt="{$productdetailcoloritem.colorname}">
																</td>
																<td width="5">&nbsp;</td>
															{/foreach}      
															{/if}
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="brd_bott">
                                                <strong>Kho hàng:</strong>
                                            </td>
                                            <!-- Thay đổi ở đây -->
                                            <td class="brd_bott">
												{if ($productdetail[0].inventory - $productdetail[0].quantity_buying)> 0}
													Còn hàng
												{else}
													<span class="fontred">Hết hàng</span>
												{/if}
                                            </td>
                                        </tr>
                                        <!-- Không biết làm, bỏ
                                        <tr>
                                            <td class="brd_bott">
                                                <strong>Lượt xem:</strong>
                                            </td>
                                            <td class="brd_bott">1298</td>
                                        </tr>
                                        -->

                                        <!-- Nút mua hàng, kiểm tra xem login hay chưa? -->
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>
                                                <br>
                                                <table border="0" cellpadding="0" cellspacing="0">
                                                    <tbody>
                                                        <tr>
                                                            <td>
                                                                <form action="/cart/add/{$productdetail[0].idproduct}" method="post" style="margin:0">
                                                                    <!-- Thay đổi ở đây -->
                                                                    <input type="hidden" name="idcth" value="361">
                                                                    <input type="hidden" name="proname" value="Nikon Coolpix S4300">
                                                                    <input type="hidden" name="price" value="2990000">
                                                                    <input type="hidden" name="poids" value="139">
                                                                    <input type="hidden" name="img" value="./upload/posts/361.jpg">
																	{if ($productdetail[0].inventory - $productdetail[0].quantity_buying)> 0}
																		<input type="image" src="/templates/images/but-book.jpg">
																	{/if}
                                                                </form>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <br>
                <!-- 3 menu cố định -->
                <div id="pettabs" class="indentmenu">
                    <ul>
                        <li>
                            <a href="#" rel="dog1" class="selected">
                                <strong>Chi tiết sản phẩm</strong>
                            </a>
                        </li>
                        <li>
                            <a href="#" rel="dog2" class="">
                                <strong>Bài viết sản phẩm</strong>
                            </a>
                        </li>
                        <li>
                            <a href="#" rel="dog3" class="">                   
                                <strong>Ý kiến khách hàng</strong>
                            </a>
                        </li>
                    </ul>
                    <br style="clear: left">
                </div>

                <!-- Chọn menu nào thì tab đó xuất hiện -->
                <div style="border:1px solid #CCCCCC; width:750px; padding-bottom:10px; padding-left:10px; padding-right:10px; padding-top:10px;">
                    <!-- Dog 1, chèn nội dung vào đây --->
                    <div id="dog1" class="tabcontent" style="display: block;">
                        {$productdetail[0].productdetail}
                    </div>

                    <!-- Dog 2, chèn nội dung vào đây --->
                    <div id="dog2" class="tabcontent" style="display: none;">

                    </div>

                    <!-- Dog 3, chèn nội dung vào đây --->
                    <div id="dog3" class="tabcontent" style="display: none;">
                        <script language="JavaScript" type="text/javascript">
                            function CheckfbcusForm(theForm)
                            {
                                with(theForm)
                                {
                                    if (name.value=="")
                                    {
											alert("Vui lòng nhập Họ và tên.");
                                        name.focus();
                                        return false;
                                    }
                                    if(content.value == "")
                                    {
                                        alert('Vui lòng nhập nội dung comment.')
									content.focus()
									return false
								}
								if(codeprotect.value == "")
                                    {
									alert('Vui lòng nhập mã bảo vệ.')
								codeprotect.focus()
								return false
							}
							if(codeprotect.value != codeprotect2.value)
                                    {
								alert('Mã bảo vệ không đúng. Vui lòng nhập lại mã bảo vệ.')
							codeprotect.focus()
							return false
						}
						return true
					}
				}
                        </script>
                        <form action="addfbcus.php" name="fbcusForm" enctype="multipart/form-data" style="margin:0; padding:0" onsubmit="return CheckfbcusForm(this)">
                            <input type="hidden" name="idnewscat" value="37">
                            <input type="hidden" name="idnews" value="361">
                            <input type="hidden" name="tieudeurl" value="Nikon-Coolpix-S4300">
                            <br>
                            <table width="60%" border="0" cellspacing="0" cellpadding="4">
                                <tbody>
                                    <tr>
                                        <td width="25%" valign="top">Họ tên: (*)</td>
                                        <td valign="top">
                                            <input type="text" name="name" id="name" class="box_input2" style="width:99%">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">Địa chỉ email:</td>
                                        <td valign="top">
                                            <input type="text" name="email" id="email" class="box_input2" style="width:99%">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">Nội dung: (*)</td>
                                        <td valign="top">
                                            <textarea name="content" id="content" cols="45" rows="5" class="box_input2" style="width:99%">
                                            </textarea>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">Mã bảo vệ (*)</td>
                                        <td valign="top">
                                            <table border="0" cellspacing="0" cellpadding="0">
                                                <tbody>
                                                    <tr>
                                                        <td width="80">
                                                            <input type="text" name="codeprotect" id="codeprotect" class="box_input2"></td>
                                                        <td width="10px">&nbsp;</td>
                                                        <td class="title16">1512
                                                            <!-- Mã bảo vệ, làm sao có ^^ --->
                                                            <input name="codeprotect2" type="hidden" id="codeprotect2" value="1512">
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">&nbsp;</td>
                                        <td valign="top">
                                            <input type="image" src="/templates/images/btn_send.jpg"> </td>
                                    </tr>
                                    <tr>
                                        <td valign="top">&nbsp;</td>
                                        <td valign="top">&nbsp;</td>
                                    </tr>
                                </tbody>
                            </table>
                        </form>
                        <table width="100%" border="0" cellpadding="5" cellspacing="0"></table>
                    </div>
                </div>
            </td>
        </tr>
    </tbody>
</table>

<script type="text/javascript">
var mypets=new ddtabcontent("pettabs")
mypets.setpersist(true)
mypets.setselectedClassTarget("link")
mypets.init(0)
</script>
<br>

<!-- Sản phẩm khác -->
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td class="bgtitle">
                <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                    <tbody>
                        <tr>
                            <td width="10" valign="bottom">&nbsp;</td>
                            <td width="20">
                                <img src="/templates/images/mui_ten.gif">
                            </td>
                            <td valign="bottom" class="title">Sản phẩm khác</td>
                            <td width="10" valign="bottom">&nbsp;</td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>

        <tr>
            <td valign="top">
                <img src="/templates/images/space.gif" width="1" height="10">
            </td>
        </tr>

        <tr> 
            <td>
                <table align="center" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                        <!-- 3 tr, mỗi tr có 3 td-->
						{foreach from=$product_cung_loai item=product_cung_loai_item}
							{if $product_cung_loai_item@index % 3== 0}
								<tr>
								{/if}
								<td valign="top">
									<input name="idprocheck[]" type="hidden" value="259">
									<table width="260" border="0" align="center" cellpadding="0" cellspacing="0">
										<tbody>
											<tr>
												<td> 
													<table width="100%" border="0" cellspacing="0" cellpadding="0">
														<tbody>
															<tr>
																<td width="11">
																	<img src="/templates/images/tbl_pro1.jpg" width="11" height="11">
																</td>
																<td background="/templates/images/tbl_pro2.jpg">
																	<img src="/templates/images/tbl_pro2.jpg" width="1" height="11">
																</td>
																<td width="11">
																	<img src="/templates/images/tbl_pro3.jpg" width="11" height="11">
																</td>
															</tr>
														</tbody>
													</table>
												</td>
											</tr>
											<tr>
												<td>
													<table width="100%" border="0" cellspacing="0" cellpadding="0">
														<tbody>
															<tr>
																<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
																<td>
																	<img src="/templates/images/posts.gif">&nbsp;
																	<!-- Sửa -->
																	<a href="/product/camera" class="linktitlebox">Máy ảnh</a> | 
																	<a href="/{$product_cung_loai_item.link}" class="linktitlebox">{$product_cung_loai_item.categoryname}</a>
																	{if $promotion_start == 1}
																		<span style="float: right; font-weight: bold; margin-top: 2px; color:red">{$promotionbytime.percentdiscount}%</span>
																		<img src="/templates/images/sale.png" style="float: right;">
																	{/if}
																</td>
																<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
															</tr>
															<tr>
																<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
																<td height="270">
																	<div align="center">
																		<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
																			<tbody>
																				<tr>
																					<td align="left">
																						<!-- Sửa -->
																						<a style="cursor:hand" href="/productdetail/{$product_cung_loai_item.idproduct}"> 
																							<img src="/templates/images/product/{$product_cung_loai_item.image}" alt="{$product_cung_loai_item.productname}" width="180" height="260" border="0"> 
																						</a>
																					</td>
																				</tr>
																			</tbody>
																		</table>
																	</div>
																</td>
																<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
															</tr>
															<tr>
																<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
																<td height="50" valign="top">
																	<div align="center">
																		<h3 style="margin:0px;">
																			<!-- Sửa -->
																			<a style="cursor:hand" href="/productdetail/{$product_cung_loai_item.idproduct}" class="linkblack">{$product_cung_loai_item.productname}</a>
																		</h3>
																		<span class="{if $promotion_start == 1}fontgrayprice{else}fontred{/if}">{$product_cung_loai_item.price|number_format} VNĐ</span>
																		<br>
																		{if $promotion_start == 1}
																			<img src="/templates/images/sale_arrow.png" style="position: absolute; margin-top: -11px; margin-left: -60px;">
																			<span class="fontred">{($product_cung_loai_item.price*(100-$promotionbytime.percentdiscount)/100)|number_format} VNĐ</span>
																			<br>
																		{/if}
																		<span class="fontgreen">{$product_cung_loai_item.promotion}</span>
																	</div>
																</td>
																<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
															</tr>
														</tbody>
													</table>
												</td>
											</tr>
											<tr>
												<td>
													<table width="100%" border="0" cellspacing="0" cellpadding="0">
														<tbody>
															<tr>
																<td width="11">
																	<img src="/templates/images/tbl_pro6.jpg" width="11" height="44"></td>
																<td background="/templates/images/tbl_pro7.jpg" style="padding-bottom:3px">
																	<form action="/cart/add/{$product_cung_loai_item.idproduct}" method="post" style="margin:0">
																		<table border="0" align="center" cellpadding="2" cellspacing="0">
																			<!-- Sửa -->
																			<input type="hidden" name="idcth" value="{$product_cung_loai_item.productid}">
																			<input type="hidden" name="proname" value="{$product_cung_loai_item.productname}">
																			<input type="hidden" name="price" value="{$product_cung_loai_item.price}">
																			<input type="hidden" name="poids" value="">
																			<input type="hidden" name="img" value="{$product_cung_loai_item.image}">
																			<tbody>
																				<tr>
																					<!-- Nút chi tiết  -->
																					<td>
																						<a style="cursor:hand" href="/productdetail/{$product_cung_loai_item.idproduct}">
																							<img src="/templates/images/but-detail.jpg" border="0"></a>
																					</td>
																					<td width="2">
																						<img src="/templates/images/space.gif" width="2">
																					</td>
																					<!--nut mua-->
																					<td>
																						{if ($product_cung_loai_item.inventory - $product_cung_loai_item.quantity_buying) > 0}
																							<input type="image" src="/templates/images/but-book.jpg"></a>
																						{else}
																							<span class="fontred">Hết hàng</span>
																						{/if}
																					</td>
																				</tr>
																			</tbody>
																		</table>
																	</form>
																</td>
																<td width="11">
																	<img src="/templates/images/tbl_pro8.jpg" width="11" height="44">
																</td>
															</tr>
														</tbody>
													</table>
												</td>
											</tr>
										</tbody>
									</table>
								</td>
								{if $product_cung_loai_item@index %3 == 2}
								</tr>
							{/if}
						{/foreach}

                        <tr>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </tbody>
</table>